apiVersion: v1
kind: Service
metadata:
  labels:
    name: mongo-01
  name: mongo-01
  namespace: spark-cluster
spec:
  type: NodePort
  ports:
    - port: 27017
      targetPort: 27017
      nodePort: 30017
      name: mongo
    - port: 22
      targetPort: 22
      nodePort: 30222
      name: mongo-ssh
  selector:
    name: mongo-node-01


---
apiVersion: v1
kind: ReplicationController
metadata:
  name: mongo-01
  namespace: spark-cluster
spec:
  replicas: 1
  selector:
    name: mongo-node-01
    role: mongo
    environment: test
  template:
    spec:
      containers:
        - name: mongo-node-01
          image: index.tenxcloud.com/zhangshun/mongo:3.2.9
          ports:
            - containerPort: 27017
          volumeMounts:
            - name: rta-mongo
              mountPath: /data/db
      volumes:
        - name: rta-mongo
          glusterfs:
              endpoints: glusterfs-cluster
              path: {{ gluster_rta_mongo_volname }}
              readOnly: false
    metadata:
      labels:
        name: mongo-node-01
        role: mongo
        environment: test
